# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-pyim-basedict
pkgver=0.5.3
pkgrel=0
_pkgreal=pyim-basedict
pkgdesc="Default Pinyin dict for Emacs-pyim"
url="https://github.com/tumashu/pyim-basedict"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox emacs-pyim"
source="https://github.com/tumashu/pyim-basedict/archive/v$pkgver/emacs-pyim-basedict-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-$pkgver"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc ./*.pyim \
		-t "$pkgdir"/usr/share/emacs/site-lisp/pyim/

	cd "$pkgdir"/usr/share/emacs/site-lisp/pyim
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
453a4caab29195baac23160ee95116af7033852e8cd79fd9824e5efe94c6bc480709457817c388b68bdf1ac002e01297e8395abd517a0a17d121cc5705d392fe  emacs-pyim-basedict-0.5.3.tar.gz
"
